export const mainMixin = {
    data() {
        return {
            ipagination: {
                current: 1,
                pageSize: 10,
                pageSizeOptions: ['10', '20', '30'],
                showTotal: (total, range) => {
                    return range[0] + "-" + range[1] + " 共" + total + "条"
                },
                total: 0
            }
        }
    },
    created() {

    },
    methods: {
        handleTableChange(pagination, filters, sorter) {
            this.ipagination = pagination;
            this.form.pageVo.pageNumber = pagination.current;
            this.form.pageVo.pageSize = pagination.pageSize;
            this.getList(this.form);
        },
        getList() {
            this.loading = true;
            this.$http(this.url, this.form).then((res) => {
                if(res.code == '200'){
                    this.loading = false;
                    this.dataList = res.result.records;
                    this.ipagination.total = res.result.total;
                    this.dataList.forEach((item,i)=>{
                        item.xuhao = (i+1) + (res.result.current-1)*10
                    })
                }else{
                    this.$message.error(res.message);
                }
            });
          },
    }

}